package com.shujia.scala

object Demo19Object {
  def main(args: Array[String]): Unit = {

    Dog.print()
    println(Dog.name)
  }
}
//伴生对象（单例）,底层是java中static
object Dog {
  val name: String = "张三"
  val age: Int = 23

  def print(): Unit = println(s"$name\t$age")

}
